//
//  WorkSummaryDynamicCellConstraintFactory.m
//  RSW.IOS
//
//  Created by zhaiqiuqiu on 16/12/22.
//  Copyright © 2016年 com.xtion.crm. All rights reserved.
//

#import "WorkSummaryDynamicCellConstraintFactory.h"

@implementation WorkSummaryDynamicCellConstraintFactory

+(XMSQueueDictionary*)factoryForModify:(ExpandInfo*)expandInfo
{
    return [[WorkSummaryDynamicCellConstraintFactory new] factoryForModify:expandInfo];
}

+(XMSQueueDictionary*)factoryForReview:(ExpandInfo*)expandInfo
{
    return [[WorkSummaryDynamicCellConstraintFactory new] factoryForReview:expandInfo];
}

-(XMSQueueDictionary*)originConstraint
{
    XMSQueueDictionary *tmp = [XMSQueueDictionary new];
    
    [tmp addKey:@"基本信息" value:[NSMutableArray arrayWithObjects:
                               [self title],[self content],nil]];
    
    return tmp;
}

-(XMSQueueDictionary*)factoryForModify:(ExpandInfo*)expandInfo
{
    return [self factoryForModify:expandInfo originConstraint:[self originConstraint]];
}

-(XMSQueueDictionary*)factoryForReview:(ExpandInfo*)expandInfo
{
    return [self factoryForReview:expandInfo originConstraint:[self originConstraint]];
}


-(FieldDescript*)title
{
    FieldDescript *fix = [FieldDescript new];
    fix.controlType = [XMSNumberInt numberIntWithIntValue:DynamicFieldControlTypeBigText];
    fix.entityRegID = @"";
    fix.expandFieldID = @"";
    fix.fieldLabel = @"标题";
    fix.fieldLength = [XMSNumberInt numberIntWithIntValue:50];
    fix.fieldName = @"Title";
    fix.fieldType = [XMSNumberInt numberIntWithIntValue:DynamicFieldTypeSystem];
    fix.isAllowEmpty = [XMSNumberInt numberIntWithIntValue:0];
    fix.isReadOnly = [XMSNumberInt numberIntWithIntValue:0];
    fix.optional = @"";
    fix.order = [XMSNumberInt numberIntWithIntValue:0];
    fix.regx = @"";
    fix.status = nil;
    fix.optIsVisible = [XMSNumberInt numberIntWithIntValue:1];
    fix.viewIsVisible = [XMSNumberInt numberIntWithIntValue:1];
    return fix;
}

-(FieldDescript*)content
{
    FieldDescript *fix = [FieldDescript new];
    fix.controlType = [XMSNumberInt numberIntWithIntValue:DynamicFieldControlTypeBigText];
    fix.entityRegID = @"";
    fix.expandFieldID = @"";
    fix.fieldLabel = @"内容";
    fix.fieldLength = [XMSNumberInt numberIntWithIntValue:500];
    fix.fieldName = @"Content";
    fix.fieldType = [XMSNumberInt numberIntWithIntValue:DynamicFieldTypeSystem];
    fix.isAllowEmpty = [XMSNumberInt numberIntWithIntValue:0];
    fix.isReadOnly = [XMSNumberInt numberIntWithIntValue:0];
    fix.optional = @"";
    fix.order = [XMSNumberInt numberIntWithIntValue:1];
    fix.regx = @"";
    fix.status = nil;
    fix.optIsVisible = [XMSNumberInt numberIntWithIntValue:1];
    fix.viewIsVisible = [XMSNumberInt numberIntWithIntValue:1];
    return fix;
}

@end
